package org.madgecko.web;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class SessionAndCommandListener implements HttpSessionListener{

	@Override
	public void sessionCreated(HttpSessionEvent se) {
//		System.out.println("创建了session:" + se.getSession().getId() + ", 并加载了该用户的权限.");
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent se) {
		String sid = se.getSession().getId();
		SessionContext.removeSession(sid);
		CommandContext.removeUserCommand(sid);
//		System.out.println("销毁了session:" + sid + ", 并移除了该用户的权限.");
	}
}
